﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace StuManagementSystem
{

    public partial class frm_ManagerIndex : Form
    {
        /// <summary>
        /// 是否关闭变量
        /// </summary>
        public bool isClose = true;
        private int AdminId;
        public frm_ManagerIndex()
        {
            InitializeComponent();
        }
        public frm_ManagerIndex(int Id)
        {
            InitializeComponent();
            AdminId = Id;
        }

        private void frm_Index_Load(object sender, EventArgs e)
        {

        }

        #region 账户管理
        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void mns_ChangePwd_Click(object sender, EventArgs e)
        {
            frm_ChangePwd frm = new frm_ChangePwd(AdminId,"Manager");
            frm.MdiParent = this;
            frm.Show();
        }
        /// <summary>
        /// 用户更改
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void mns_AccountChange_Click(object sender, EventArgs e)
        {
            this.Owner.Show();
            isClose = false;
            this.Close();
        }
        /// <summary>
        /// 程序退出
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void mns_Exit_Click(object sender, EventArgs e)
        {
            this.Close();
        }
        #endregion

        #region 学生用户管理
        /// <summary>
        /// 新增学生用户
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void mns_AddStuInfo_Click(object sender, EventArgs e)
        {
            frm_AddStuInfo frm = new frm_AddStuInfo();
            frm.MdiParent = this;
            frm.Show();
        }
        /// <summary>
        /// 按学生姓名查找
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void mns_StuIndexbyName_Click(object sender, EventArgs e)
        {
            frm_StuIndexbyName frm = new frm_StuIndexbyName();
            frm.MdiParent = this;
            frm.Show();
        }
        /// <summary>
        /// 按学生年级查找
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void mns_StuIndexbyGrade_Click(object sender, EventArgs e)
        {
            frm_StuIndexbyGrade frm = new frm_StuIndexbyGrade();
            frm.MdiParent = this;
            frm.Show();
        }
        /// <summary>
        /// 学生信息列表
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void mns_StuInfoList_Click(object sender, EventArgs e)
        {
            frm_StuInfoList frm = new frm_StuInfoList();
            frm.MdiParent = this;
            frm.Show();
        }
        #endregion

        #region 科目管理

        /// <summary>
        /// 学生科目列表
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void mns_SubjectList_Click(object sender, EventArgs e)
        {
            frm_SubjectList frm = new frm_SubjectList();
            frm.MdiParent = this;
            frm.Show();
        }
        #endregion

        #region 窗口

        #endregion

        #region 帮助
        /// <summary>
        /// 关于
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void mns_AboutUs_Click(object sender, EventArgs e)
        {
            frm_AboutUs frm = new frm_AboutUs();
            frm.ShowDialog();
        }
        #endregion

        #region 窗体关闭程序
        /// <summary>
        /// 关闭窗口
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frm_Index_FormClosed(object sender, FormClosedEventArgs e)
        {
            if (isClose == true)
                Application.Exit();
        }
        #endregion

        

        


    }
}
